package org.Yiran.timetale_re.recipe;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import org.Yiran.timetale_re.Timetale_re;

public class ModRecipes {
    public static final DeferredRegister<RecipeSerializer<?>> RECIPE_SERIALIZERS = 
            DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, Timetale_re.MODID);
    
    public static final DeferredRegister<RecipeType<?>> RECIPE_TYPES = 
            DeferredRegister.create(ForgeRegistries.RECIPE_TYPES, Timetale_re.MODID);
    
    // 注册配方类型
    public static final RegistryObject<RecipeType<AnvilForgeRecipe>> ANVIL_FORGE_RECIPE_TYPE = 
            RECIPE_TYPES.register("anvil_forge", () -> new RecipeType<>() {
                @Override
                public String toString() {
                    return ResourceLocation.fromNamespaceAndPath(Timetale_re.MODID, "anvil_forge").toString();
                }
            });
    
    // 注册配方序列化器
    public static final RegistryObject<RecipeSerializer<AnvilForgeRecipe>> ANVIL_FORGE_RECIPE_SERIALIZER = 
            RECIPE_SERIALIZERS.register("anvil_forge", AnvilForgeRecipe.Serializer::new);
}